// app.js
App({
  globalData: {
    userType: 1,
    timeNum: 1,
    order: null,
    showstoreid:null,
    appproductList:[],
    appstorename:'美业团'
  },
  onLaunch() {
    wx.hideTabBar();
  },
  onLoad(){
    wx.hideShareMenu();
  },
  settitle(){
    var that = this;
    wx.setNavigationBarTitle({
      title: that.globalData.appstorename
    })
  },
  goHome() {
    if (this.globalData.userType == 1) {
      if (this.globalData.order) {
        wx.reLaunch({
          url: '/pages/user/invite',
        })
      } else {
        wx.switchTab({
          url: '/pages/home/home',
        })
      }
    } else if (this.globalData.userType == 2 || this.globalData.userType == 3 || this.globalData.userType == 8) {
      wx.switchTab({
        url: '/pages/store/owner',
      })
    } else if (this.globalData.userType == 4) {
      wx.reLaunch({
        url: '/pages/store/staff',
      })
    } else if (this.globalData.userType == 5 || this.globalData.userType == 6) {
      wx.switchTab({
        url: '/pages/team/staff',
      });
    } else if (this.globalData.userType == 7) {
      wx.reLaunch({
        url: '/pages/home/sales',
      });
    }
  }
})
